package logic;

import java.util.ArrayList;
import java.util.List;

public class Pattern {
	private List<Action> actions = new ArrayList<Action>();
	private int index = 0;
	
	public void resetToStart() {
		index = 0;
	}
	public void extend(Action action) {
		actions.add(action);
		resetToStart();
	}
	
	public Action getNextAction() {
		if (index < actions.size()) {
			return actions.get(index++);
		} else {
			return actions.get(index++);
		}
	}
	
	public int size(){
		return actions.size();
	}
	
	public boolean hasMore() {
		return (index < actions.size());
	}
}
